<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 需求：打印一行5个小星星。 
        let num = '';
        for (let i = 1; i < 6; i++) {
            num = num + '*';
        }
        console.log(num);
        // 打印 4 行， 每行 5 个小星星
        for (let j = 1; j < 5; j++) {
            let num = '';
            for (let i = 1; i < 6; i++) {
                num = num + '*';
                
            }
            console.log(num,j);
        }
        
        // 让用户决定打印几行，几列小星星。
        let sum1 = prompt('请输入星星行数');
        let sum = prompt('请输入星星每行个数');
        for (let j = 0; j < sum1; j++) {
            let num = '';
            for (let i= 0; i < sum; i++) {
                num = num + '*';
                
            }
            console.log(num,j);
        }
    </script>
</body>

</html>